# coding: utf-8


def all_params(keys, product_info):
    """
    create by ld_wu 2018-01-04
    获取所有产品的技术参数
    :param keys:
    :param product_info:
    :return:
    """
    return (product_info.get(key, list()) for key in keys)


def recursion_params(params):

    for param in params:
        sub_params = param.get('subParams')
        if sub_params:
            params.extend(recursion_params(sub_params))
    return params
